package com.szpx.mapper;

import com.szpx.entity.ZJH.DriverReservation;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface DriverReservationMapper {

    @Select("SELECT * FROM driving_reservation WHERE id = #{id}")
    DriverReservation selectById(String id);

    @Select("SELECT * FROM driving_reservation")
    List<DriverReservation> selectAll();

    @Insert("INSERT INTO driving_reservation(id,student_name, phone, license_type, reservation_date, time_slot, coach_name, status) " +
            "VALUES (#{id},#{studentName}, #{phone}, #{licenseType}, #{reservationDate}, #{timeSlot}, #{coachName}, #{status})")
    int insert(DriverReservation reservation);

    @Update("UPDATE driving_reservation SET student_name=#{studentName}, phone=#{phone}, license_type=#{licenseType}, " +
            "reservation_date=#{reservationDate}, time_slot=#{timeSlot}, coach_name=#{coachName}, status=#{status} WHERE id=#{id}")
    int update(DriverReservation reservation);

    @Delete("DELETE FROM driving_reservation WHERE id = #{id}")
    int delete(Integer id);
}
